/**
 * Copyright (C) 2011 KingCore Science & Technology CO,.LTD. All rights reserved.
 * XNS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/**
 * Copyright (C) 2002-2011 WUZEWEN. All rights reserved.
 * WUZEWEN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 * This software is the confidential and proprietary information of
 * WuZeven, Personal. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with WuZeven.
 */

package com.kingcore.director.base.ui;

import java.awt.Event;
import java.awt.event.KeyEvent;
import java.util.Observable;
import java.util.Observer;
import java.util.ResourceBundle;

import javax.swing.AbstractAction;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.KeyStroke;

import wzw.util.I18nUtil;
import wzw.util.I18nUtils;

import com.kingcore.director.DirectorConstants;
import com.kingcore.director.main.Main;
import com.kingcore.director.main.MainFrame;

/**
 * <p>Director 系统所有MenuBar的基类，主要是生成界面，具体的执行在对应的 Windows(JPane)中。</p>
 * @author Zeven on 2011-4-8
 * @version	1.0
 * @see		Object#equals(java.lang.Object)
 * @since	JDK5
 */

public class DirectorMenuBar extends JMenuBar implements Observer {


//	private JMenuBar mainMenu = null;                  //菜单条
	public JMenuItem jmi_Help_About= null;	
	public JMenuItem jmi_Tool_RefreshLocalSearch;
	public JMenuItem jmi_Tool_MyReminder;
	public JMenuItem jmi_Tool_MyCalendar;
	public JMenuItem jmi_Tool_FileExplorer;
	public JMenuItem jmi_Tool_FileCopy;
	public JMenuItem jmi_Tool_ResourceMaster;
	public JMenuItem jmi_Tool_FavoriteFiles;
	public JMenuItem jmi_Tool_DocumentLibrary;
	public JMenuItem jmi_Tool_ProgramLibrary;
	public JMenuItem jmi_Tool_LocalSearch;
//	public JMenuItem jmi_Tool_MyNoteBook;
	public JMenuItem jmi_Tool_MyNotePaper;
	public JMenuItem jmi_Tool_Preference;
//	public JMenuItem jmi_Tool_SendMail;
	public JCheckBoxMenuItem jmi_Tool_OpenNoDisturb;
	public JMenu jm_Tool;
	public JMenu jm_View;
	public JCheckBoxMenuItem jmi_View_ToolBar;
	public JCheckBoxMenuItem jmi_View_StatusBar;
	public JMenuItem jmi_File_Exit;
//	public JMenuItem jmi_Help_Topic;
	public JMenuItem jmi_Edit_NewAwoke;
	public JMenuItem jmi_Edit_ModAwoke;
	public JMenuItem jmi_Edit_DelAwoke;
	
//	public JMenuItem jmi_Edit_CopyAwoke;
//	public JMenuItem jmi_Edit_SearchAwoke;
//	public JMenuItem jmi_Edit_SelectallAwoke;
	public JMenuItem jmi_Edit_TestAwoke;
//	public JMenuItem jmi_Edit_SetEffect;
//	public JMenuItem jmi_Edit_Showin10000;
//	public JMenuItem jmi_Edit_CompletePre;
	
//	public JMenuItem jmi_File_Impdata;
//	public JMenuItem jmi_File_Expdata;
//	public JMenuItem jmi_File_Userset;
//	public JMenuItem jmi_File_Userlogout;
	public JMenuItem jmi_File_Restart;
	public JMenu jm_View_LookAndFeel;
	public JRadioButtonMenuItem jmi_View_LookAndFeel_Windows;
	public JRadioButtonMenuItem jmi_View_LookAndFeel_Metal;
	public JRadioButtonMenuItem jmi_View_LookAndFeel_Motif;
	public JMenu jm_View_Language;
	public JRadioButtonMenuItem jmi_View_Language_ChineseCN;
	public JRadioButtonMenuItem jmi_View_Language_ChineseTW;
	public JRadioButtonMenuItem jmi_View_Language_English;
	public JMenu jm_File;
	public JMenu jm_Edit;
	public JMenu jm_Help;
	public JMenuItem jmi_Tool_Unicode;
	public JRadioButtonMenuItem jmi_View_Language_Japanese;
	public AbstractAction showToolBarAction=null;
	public boolean isToolBarShow=true;
	public AbstractAction showStatusBarAction;
	public boolean isStatusBarShow=true;
	public JMenu jm_Init;
	public JMenuItem jmi_Init_Flxx;
	public JMenuItem jmi_Init_Filebackup;
//	public JMenuItem jmi_Init_Mail;



	 /**
	  * 监听语言改变
	  */
	public void update(Observable o, Object arg) {
		
		//System.out.println(Locale.getDefault());
		ResourceBundle bundle = I18nUtils.getBundle(DirectorConstants.I18n_Language_Name);
//		 1.JMenuItem
//		 文件
		jm_File.setToolTipText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.ToolTipText"));	//"文件操作菜单"
		jm_File.setText(I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.Text"));		//"文件操作菜单"

//		jmi_File_Impdata.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Impdata.Text") );
//		jmi_File_Expdata.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Expdata.Text") );
//		jmi_File_Userset.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Userset.Text") );
//		jmi_File_Userlogout.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Userlogout.Text") );  
		jmi_File_Restart.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Restart.Text") );  
		jmi_File_Exit.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_File.jmi_File_Exit.Text") );
		
//		 编辑  
		jm_Edit.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.Text") );
		
		jmi_Edit_NewAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_NewAwoke.Text") );
		jmi_Edit_ModAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_ModAwoke.Text") );
		jmi_Edit_DelAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_DelAwoke.Text") );
//		jmi_Edit_CopyAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_CopyAwoke.Text") );
//		jmi_Edit_SearchAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_SearchAwoke.Text") );
//		jmi_Edit_SelectallAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_SelectallAwoke.Text") );
		jmi_Edit_TestAwoke.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_TestAwoke.Text") );
//		jmi_Edit_SetEffect.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_SetEffect.Text") );
//		jmi_Edit_Showin10000.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_Showin10000.Text") );
//		jmi_Edit_CompletePre.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Edit.jmi_Edit_CompletePre.Text") );
		
		//视图
		jm_View.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.Text") );

		jmi_View_ToolBar.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jmi_View_ToolBar.Text") );
		jmi_View_StatusBar.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jmi_View_StatusBar.Text") );

		jm_View_LookAndFeel.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_LookAndFeel.Text") );

		jmi_View_LookAndFeel_Windows.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_LookAndFeel.jmi_View_LookAndFeel_Windows.Text") );
		jmi_View_LookAndFeel_Metal.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_LookAndFeel.jmi_View_LookAndFeel_Metal.Text") );
		jmi_View_LookAndFeel_Motif.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_LookAndFeel.jmi_View_LookAndFeel_Motif.Text") );

		jm_View_Language.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_Language.Text") );

		jmi_View_Language_ChineseCN.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_Language.jmi_View_Language_ChineseCN.Text") );
		jmi_View_Language_ChineseTW.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_Language.jmi_View_Language_ChineseTW.Text") );
		jmi_View_Language_English.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_Language.jmi_View_Language_English.Text") );
		jmi_View_Language_Japanese.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_View.jm_View_Language.jmi_View_Language_Japanese.Text") );

//		工具
		jm_Tool.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.Text") );

		jmi_Tool_DocumentLibrary.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_DocumentLibrary.Text") );
		jmi_Tool_FavoriteFiles.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_FavoriteFiles.Text") );
		jmi_Tool_FileCopy.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_CopyFile.Text") );
		jmi_Tool_FileExplorer.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_FileExplorer.Text") );
		jmi_Tool_LocalSearch.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_LocalSearch.Text") );
		jmi_Tool_MyCalendar.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_MyCalendar.Text") );
//		jmi_Tool_MyNoteBook.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_MyNoteBook.Text") );
		jmi_Tool_MyNotePaper.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_MyNotePaper.Text") );
		jmi_Tool_MyReminder.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_MyReminder.Text") );
		jmi_Tool_ProgramLibrary.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_ProgramLibrary.Text") );
		jmi_Tool_RefreshLocalSearch.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_RefreshLocalSearch.Text") );
		jmi_Tool_ResourceMaster.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_ResourceMaster.Text") );
		jmi_Tool_Unicode.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_Unicode.Text") );
//		jmi_Tool_SendMail.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_SendMail.Text") );
		jmi_Tool_Preference.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_Preference.Text") );
		jmi_Tool_OpenNoDisturb.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Tool.jmi_Tool_OpenNoDisturb.Text") );
		
//		初始
		jm_Init.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Init.Text") );

		jmi_Init_Flxx.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Init.jmi_Init_Flxx.Text") );
		jmi_Init_Filebackup.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Init.jmi_Init_Filebackup.Text") );
//		jmi_Init_Mail.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Init.jmi_Init_Mail.Text") );

		
//		帮助
		jm_Help.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Help.Text") );
//		jmi_Help_Topic.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Help.jmi_Help_Topic.Text") );
		jmi_Help_About.setText( I18nUtil.getBundleString(bundle, DirectorMenuBar.class, "mainMenu.jm_Help.jmi_Help_About.Text") );
	}
	
	
	
	public DirectorMenuBar(DirectorPanel directorPanel) {
		super(); 
			
			// 1.JMenuItem
			// 文件
		//下面内容因为发布，精简掉
//			jmi_File_Impdata = new JMenuItem("导入提醒纪录...");     
//			jmi_File_Expdata = new JMenuItem("导出提醒纪录...");       
//			jmi_File_Userset = new JMenuItem("帐户设置");      
//			jmi_File_Userlogout = new JMenuItem("注销用户");   
			jmi_File_Restart = new JMenuItem("重启应用");    
			jmi_File_Exit = new JMenuItem("退出程序"); 
			jmi_File_Restart.addActionListener(directorPanel);
			jmi_File_Exit.addActionListener(directorPanel);
			
			// 编辑  
			jmi_Edit_NewAwoke = new JMenuItem("新提醒");   
			jmi_Edit_NewAwoke.addActionListener(directorPanel);
			jmi_Edit_NewAwoke.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N,Event.CTRL_MASK) );
			jmi_Edit_ModAwoke = new JMenuItem("修改提醒");   
			jmi_Edit_ModAwoke.addActionListener(directorPanel);   
			jmi_Edit_ModAwoke.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_M,Event.CTRL_MASK) );
			jmi_Edit_DelAwoke = new JMenuItem("删除提醒"); 
			jmi_Edit_DelAwoke.addActionListener( directorPanel );
			jmi_Edit_DelAwoke.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_D,Event.CTRL_MASK) );
//			jmi_Edit_CopyAwoke = new JMenuItem("复制提醒");   
//			jmi_Edit_SearchAwoke = new JMenuItem("查找...");   
//			jmi_Edit_SelectallAwoke = new JMenuItem("全选");  
			jmi_Edit_TestAwoke = new JMenuItem("测试");     
			jmi_Edit_TestAwoke.addActionListener( directorPanel );
			jmi_Edit_TestAwoke.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_T,Event.CTRL_MASK) );
//			jmi_Edit_SetEffect = new JMenuItem("提醒有效");     
//			jmi_Edit_Showin10000 = new JMenuItem("在万年历中显示");  
//			jmi_Edit_CompletePre = new JMenuItem("完成度");       

			// 视图
			jmi_View_ToolBar = new JCheckBoxMenuItem();
			jmi_View_ToolBar.setText("工具栏");
			jmi_View_ToolBar.setSelected(true);
			jmi_View_ToolBar.addActionListener(directorPanel);
			//jmi_View_ToolBar.setAction( directorPanel );//getShowToolBarAction() );
			
			jmi_View_StatusBar = new JCheckBoxMenuItem();
			jmi_View_StatusBar.setText("状态栏");
			jmi_View_StatusBar.setSelected(true);
			jmi_View_StatusBar.addActionListener(directorPanel);
			//jmi_View_StatusBar.setAction( getShowStatusBarAction() );
			
			jmi_View_LookAndFeel_Windows = new JRadioButtonMenuItem("Windows");
			jmi_View_LookAndFeel_Windows.addActionListener(directorPanel);
			jmi_View_LookAndFeel_Metal = new JRadioButtonMenuItem("Metal");
			jmi_View_LookAndFeel_Metal.addActionListener(directorPanel);
			jmi_View_LookAndFeel_Motif = new JRadioButtonMenuItem("Motif/CDE");
			jmi_View_LookAndFeel_Motif.addActionListener(directorPanel);
			
			ButtonGroup bg_LookAndFeel = new ButtonGroup();
			bg_LookAndFeel.add(jmi_View_LookAndFeel_Windows);
			bg_LookAndFeel.add(jmi_View_LookAndFeel_Metal);
			bg_LookAndFeel.add(jmi_View_LookAndFeel_Motif);
			if(MainFrame.lookAndFeel.equals( DirectorConstants.LookAndFeel_Windows)){			
				jmi_View_LookAndFeel_Windows.setSelected(true);							
			} else if(MainFrame.lookAndFeel.equals( DirectorConstants.LookAndFeel_Metal)){
				jmi_View_LookAndFeel_Metal.setSelected(true);			
			} else if(MainFrame.lookAndFeel.equals( DirectorConstants.LookAndFeel_Motif)){
				jmi_View_LookAndFeel_Motif.setSelected(true);				
			} else {
				jmi_View_LookAndFeel_Windows.setSelected(true);				
			}
			
			jmi_View_Language_ChineseCN = new JRadioButtonMenuItem("简体中文");
			jmi_View_Language_ChineseCN.addActionListener(directorPanel);
			jmi_View_Language_ChineseTW = new JRadioButtonMenuItem("繁体中文");
			jmi_View_Language_ChineseTW.addActionListener(directorPanel);
			jmi_View_Language_English = new JRadioButtonMenuItem("English");
			jmi_View_Language_English.addActionListener(directorPanel);
			jmi_View_Language_Japanese = new JRadioButtonMenuItem("日文");
			jmi_View_Language_Japanese.addActionListener(directorPanel);
			
			ButtonGroup bg_Language = new ButtonGroup();
			bg_Language.add(jmi_View_Language_ChineseCN);
			bg_Language.add(jmi_View_Language_ChineseTW);
			bg_Language.add(jmi_View_Language_English);
			bg_Language.add(jmi_View_Language_Japanese);
			if( MainFrame.language.equals( DirectorConstants.System_Language_CN )){
				jmi_View_Language_ChineseCN.setSelected(true);				
			} else if(MainFrame.language.equals(DirectorConstants.System_Language_TW)){
				jmi_View_Language_ChineseTW.setSelected(true);				
			} else if(MainFrame.language.equals(DirectorConstants.System_Language_EN)){
				jmi_View_Language_English.setSelected(true);				
			} else if(MainFrame.language.equals( DirectorConstants.System_Language_JP )){
				jmi_View_Language_Japanese.setSelected(true);				
			}
			
			// 工具
			jmi_Tool_FileExplorer = new JMenuItem("File Explorer");
			jmi_Tool_FileExplorer.addActionListener(directorPanel);
			jmi_Tool_FileExplorer.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_E, Event.CTRL_MASK | Event.SHIFT_MASK) );
			
			jmi_Tool_FileCopy = new JMenuItem("File Copy");
			jmi_Tool_FileCopy.addActionListener(directorPanel);
			jmi_Tool_FileCopy.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_B, Event.CTRL_MASK | Event.SHIFT_MASK) ); // , Event.CTRL_MASK) );
			
			jmi_Tool_ResourceMaster = new JMenuItem("Resource Master");
			jmi_Tool_ResourceMaster.addActionListener(directorPanel);
			jmi_Tool_ResourceMaster.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_M, Event.CTRL_MASK | Event.SHIFT_MASK) );
			
			jmi_Tool_FavoriteFiles = new JMenuItem("Favorite Files");
			jmi_Tool_FavoriteFiles.addActionListener(directorPanel);
			jmi_Tool_FavoriteFiles.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.ALT_MASK ) ); //, Event.CTRL_MASK) );
			
			jmi_Tool_DocumentLibrary = new JMenuItem("Document Library");
			jmi_Tool_DocumentLibrary.addActionListener(directorPanel);
			//jmi_Tool_DocumentLibrary.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.ALT_MASK) );
			jmi_Tool_ProgramLibrary = new JMenuItem("Program Library");
			jmi_Tool_ProgramLibrary.addActionListener(directorPanel);
			//jmi_Tool_ProgramLibrary.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.ALT_MASK) );
			
			
			jmi_Tool_MyReminder = new JMenuItem("My Reminder");
			jmi_Tool_MyReminder.addActionListener(directorPanel);			
			jmi_Tool_MyReminder.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_R, Event.ALT_MASK ) );
			
			jmi_Tool_MyCalendar = new JMenuItem("My Calendar");
			jmi_Tool_MyCalendar.addActionListener(directorPanel);			
			jmi_Tool_MyCalendar.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK | Event.SHIFT_MASK) );
			
			jmi_Tool_LocalSearch = new JMenuItem("Local Search");
			jmi_Tool_LocalSearch.addActionListener(directorPanel);			
			jmi_Tool_LocalSearch.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK | Event.SHIFT_MASK) ); // Event.ALT_MASK ) );
			
//			jmi_Tool_MyNoteBook = new JMenuItem("My NoteBook");
//			jmi_Tool_MyNoteBook.addActionListener(directorPanel);			
//			jmi_Tool_MyNoteBook.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK | Event.SHIFT_MASK) );
			
			jmi_Tool_MyNotePaper = new JMenuItem("My NotePaper");
			jmi_Tool_MyNotePaper.addActionListener(directorPanel);			
			jmi_Tool_MyNotePaper.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_W, Event.ALT_MASK) ); //Write informal essay
			
			jmi_Tool_RefreshLocalSearch = new JMenuItem("Refresh Local Search");
			jmi_Tool_RefreshLocalSearch.addActionListener(directorPanel);
//			jmi_Tool_SendMail = new JMenuItem("发送邮件");
//			jmi_Tool_SendMail.addActionListener(directorPanel);
			jmi_Tool_Unicode =  new JMenuItem("toUnicode");
			jmi_Tool_Unicode.addActionListener(directorPanel);
			jmi_Tool_Preference = new JMenuItem("首选项");
			jmi_Tool_Preference.addActionListener(directorPanel);
			jmi_Tool_OpenNoDisturb = new JCheckBoxMenuItem("开启免打扰");
			jmi_Tool_OpenNoDisturb.addActionListener(directorPanel);
			jmi_Tool_OpenNoDisturb.setSelected(Main.isNoDisturbOpen);
			
			// 初始
			jmi_Init_Flxx = new JMenuItem("类别基本信息初始");
			jmi_Init_Flxx.addActionListener(directorPanel);
			jmi_Init_Filebackup = new JMenuItem("文件备份初始");
			jmi_Init_Filebackup.addActionListener(directorPanel);
//			jmi_Init_Mail = new JMenuItem("邮箱帐号初始");
//			jmi_Init_Mail.addActionListener(directorPanel);
			
			// 帮助菜单
//			jmi_Help_Topic= new JMenuItem("主题");            //帮助主题菜单项
//			jmi_Help_Topic.addActionListener(directorPanel);
			jmi_Help_About= new JMenuItem("关于...");        //关于菜单项
			jmi_Help_About.addActionListener(directorPanel);
			
			// 2.JMenu
			jm_File = new JMenu();   
			jm_File.setToolTipText("文件操作菜单");	//
			jm_File.setText( "文件(F)");			//
			jm_File.setMnemonic('F');
//			jm_File.add(jmi_File_Impdata);
//			jm_File.add(jmi_File_Expdata);
//			jm_File.addSeparator();
//			jm_File.add(jmi_File_Userset);
//			jm_File.add(jmi_File_Userlogout);
			jm_File.add(jmi_File_Restart);
			jm_File.addSeparator();
			jm_File.add(jmi_File_Exit);			
			
			jm_Edit=new JMenu();   
			jm_Edit.setToolTipText("编辑操作菜单");
			jm_Edit.setText("编辑(E)");
			jm_Edit.setMnemonic('E');
			jm_Edit.add(jmi_Edit_NewAwoke);
			jm_Edit.add(jmi_Edit_ModAwoke);
			jm_Edit.add(jmi_Edit_DelAwoke);
			jm_Edit.addSeparator();
			jm_Edit.add(jmi_Edit_TestAwoke);	
//			jm_Edit.add(jmi_Edit_CopyAwoke);
//			jm_Edit.add(jmi_Edit_SearchAwoke);

			jm_View_LookAndFeel = new JMenu();
			jm_View_LookAndFeel.setToolTipText("外观显示风格");
			jm_View_LookAndFeel.setText("风格(S)");
			jm_View_LookAndFeel.setMnemonic('S');
			jm_View_LookAndFeel.add(jmi_View_LookAndFeel_Motif);
			jm_View_LookAndFeel.add(jmi_View_LookAndFeel_Metal);
			jm_View_LookAndFeel.add(jmi_View_LookAndFeel_Windows);

			jm_View_Language = new JMenu();
			jm_View_Language.setToolTipText("语言");
			jm_View_Language.setText("语言(L)");
			jm_View_Language.setMnemonic('L');
			jm_View_Language.add(jmi_View_Language_ChineseCN);
			jm_View_Language.add(jmi_View_Language_ChineseTW);
			jm_View_Language.add(jmi_View_Language_English);
			jm_View_Language.add(jmi_View_Language_Japanese);
			
			jm_View = new JMenu();
			jm_View.setToolTipText("视图菜单");
			jm_View.setText("视图(V)");
			jm_View.setMnemonic('V');
			jm_View.add(jmi_View_ToolBar);
			jm_View.add(jmi_View_StatusBar);
			jm_View.addSeparator();
			jm_View.add(jm_View_LookAndFeel);
			jm_View.add(jm_View_Language);			
			
			
			jm_Tool = new JMenu();
			jm_Tool.setToolTipText("工具");
			jm_Tool.setText("工具(T)");
			jm_Tool.setMnemonic('T');
			jm_Tool.add(jmi_Tool_MyReminder);
			jm_Tool.add(jmi_Tool_MyCalendar);
			jm_Tool.add(jmi_Tool_ResourceMaster);
			jm_Tool.add(jmi_Tool_LocalSearch);
//			jm_Tool.add(jmi_Tool_MyNoteBook);
			jm_Tool.add(jmi_Tool_MyNotePaper);
			jm_Tool.add(jmi_Tool_RefreshLocalSearch);	
			jm_Tool.addSeparator();	
			jm_Tool.add(jmi_Tool_FileExplorer);
			jm_Tool.add(jmi_Tool_FileCopy);
			jm_Tool.add(jmi_Tool_FavoriteFiles);
			jm_Tool.addSeparator();
			jm_Tool.add(jmi_Tool_DocumentLibrary);
			jm_Tool.add(jmi_Tool_ProgramLibrary);
			jm_Tool.addSeparator();
			jm_Tool.add(jmi_Tool_Unicode);	
//			jm_Tool.add(jmi_Tool_SendMail);
			jm_Tool.addSeparator();
			jm_Tool.add(jmi_Tool_OpenNoDisturb);
			jm_Tool.add(jmi_Tool_Preference);

			jm_Init = new JMenu();
			jm_Init.setToolTipText("信息初始");
			jm_Init.setText("初始(I)");
			jm_Init.setMnemonic('I');
			jm_Init.add(jmi_Init_Flxx );
			jm_Init.add(jmi_Init_Filebackup );
//			jm_Init.add(jmi_Init_Mail );
			
			jm_Help=new JMenu();  
			jm_Help.setToolTipText("帮助菜单");
			jm_Help.setText("帮助(H)");
			jm_Help.setMnemonic('H');
//			jm_Help.add(jmi_Help_Top、ic);
			jm_Help.add(jmi_Help_About);			
			
			// 3.JMenuBar
			this.add(jm_File);
			this.add(jm_Edit);
			this.add(jm_View);
			this.add(jm_Tool);
			this.add(jm_Init);
			this.add(jm_Help); 
	
	}
 

//	private AbstractAction getShowToolBarAction(){
//		if(showToolBarAction==null){
//			showToolBarAction = new AbstractAction(){
////				public AbstractAction(){
////					super(null,new ImageIcon(str));
////				}
//				 
//				public void actionPerformed(ActionEvent e) {
//					//System.out.println("action 1");
//					executeShowToolBar();
//				}
//				
//			};
//			//showToolBarAction.actionPerformed(e);
//		}
//		showToolBarAction.setEnabled( true );	//false 同时控制 JMenuItem 和 JToolBarButton.
//		return showToolBarAction;
//	}
//
//	private AbstractAction getShowStatusBarAction(){
//		if(showStatusBarAction==null){
//			showStatusBarAction = new AbstractAction(){
////				public AbstractAction(){
////					super(null,new ImageIcon(str));
////				}
//				 
//				public void actionPerformed(ActionEvent e) {
//					//System.out.println("action 2");
//					excecuteShowStatusBar();
//				}
//				
//			};
//			//showToolBarAction.actionPerformed(e);
//		}
//		return showStatusBarAction;
//	}
//	
//	 /**
//	  * show/hide toolBar
//	  *
//	  */
//	 private void executeShowToolBar() {
//		 
//		 isToolBarShow = !isToolBarShow;
//		 jmi_View_ToolBar.setSelected(isToolBarShow);
//		 j20.setSelected( isToolBarShow );
//		 
//		if(isToolBarShow){	//jmi_View_ToolBar.isSelected()
//			//after selected ,then ...
//			getMainContentPane().add( getToolBar(), BorderLayout.NORTH);
//		}else{
//			getMainContentPane().remove( getToolBar() );
//		}
//
//		getMainContentPane().doLayout();
//		getReminderMainPanel().doLayout();
//		
//		//getMainContentPane().repaint();
//		//getMainPanel().repaint();
//		//getMainPanel().repaint();
//		//getLeftScrollPane().doLayout();			
//		//getTree().doLayout();
//		//getMainPanel().repaint();
//		
//		this.getReminderMainPanel().doRefresh();	 
//	 } 

	 
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * <p>java method describe</p>
	 * @author Zeven on 2011-4-8
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
